package com.neuedu.service.impl;

import com.neuedu.dao.UserDao;
import com.neuedu.dao.impl.UserDaoImpl;
import com.neuedu.model.User;
import com.neuedu.service.UserService;

import java.util.List;

/**
 * @author 许中
 * @date 2024-09-06 11:01:01
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao=new UserDaoImpl();

    @Override
    public User signIn(String username, String password) {
        return userDao.selectUserByUnameAndPwd(username,password);
    }

    @Override
    public List<User> showAll() {

        List<User> users = userDao.selectAll();
        for (int i = 0; i < users.size(); i++) {
            users.get(i).setPassword("");
        }
        return users;
    }
}
